package com.molin.API.loginInterface;

import java.util.Scanner;

public class loginDemo1Test {

    public static void main(String[] args) throws InterruptedException {
        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("pls input username: ");
            String username = scanner.nextLine();
            System.out.println("pls input password: ");
            String password = scanner.nextLine();
            System.out.println("pls input AuthCode （gPass）: ");
            String authCode = scanner.nextLine();
            //login
            loginDemo1 login = new loginDemo1();
            System.out.println("AuthCode...");
            if (login.authCode(authCode)) {
                System.out.println("AuthCode Success...");
                System.out.println("Login...");
                Thread.sleep(500 * 3);
                if (login.login(username, password)) {
                    System.out.println("Login Success!!");
                    break;
                } else {
                    System.out.println("Login filed.pls try again");
                    continue;
                }
            } else {
                System.out.println("AuthCode Error,pls try again.");
                continue;
            }
        }

    }
}
